$sizeMaps: (
  none: 0,
  xs: 8,
  sm: 16,
  md: 24,
  lg: 32,
  xl: 40
);

$directionMaps: (
  l: '-left',
  r: '-right',
  t: '-top',
  b: '-bottom',
  a: ''
);

@mixin marginMixin($direction,$size) {
  margin#{$direction}: #{$size}rpx !important;
}

@mixin paddingMixin($direction,$size) {
  padding#{$direction}: #{$size}rpx !important;
}

@each $key, $value in $directionMaps {
  @each $key2, $value2 in $sizeMaps {
    .m#{$key}-#{$key2}{
      @include marginMixin($value,$value2);
    }
    .p#{$key}-#{$key2}{
      @include paddingMixin($value,$value2);
    }
  }
}